package juc.thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/03/07 12:47
 */
public class ThreadPoolCreate {
    public static ThreadPoolExecutor executorPool = new ThreadPoolExecutor(50,
            200,
            60,
            TimeUnit.MILLISECONDS,
            new ArrayBlockingQueue<>(5000),
            r -> new Thread(r, "t_pl_pool_" + r.hashCode()),
            new ThreadPoolExecutor.DiscardOldestPolicy());

    public static void main(String[] args) {
        System.out.println(executorPool.getMaximumPoolSize());
    }
}
